]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
windowManager: Allow xwayland startup to complete without systemd
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 12 May 2020 15:16:34 +0000 (17:16 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 12 May 2020 16:05:38 +0000 (18:05 +0200)
Since commit 0ecddafc207 gsd-xsettings startup has been made conditional
on the systemd user instance being available at runtime. While that is
correct, it means that completing xwayland startup is also conditional
now.

We always want xwayland startup to go ahead, so wait for the XSettings
plugin to appear on the bus when gsd-xsettings is launched by gnome-session
and complete the task immediately if startup fails.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1252

js/ui/windowManager.js

index 14c914099f5b6f1df6e8af52c4ded6c082b84408..3dacca2ecaa4e8c93f0dbe2e44ee00cf6ce79590 100644 (file)
@@ -902,31 +902,33 @@ var WindowManager = class {
             IBusManager.getIBusManager().restartDaemon(['--xim']);
 
             try {
-                if (Shell.util_start_systemd_unit('gsd-xsettings.target', 'fail')) {
-                    /* Leave this watchdog timeout so don't block indefinitely here */
-                    let timeoutId = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 5, () => {
+                if (!Shell.util_start_systemd_unit('gsd-xsettings.target', 'fail'))
+                    log('Not starting gsd-xsettings; waiting for gnome-session to do so');
+
+                /* Leave this watchdog timeout so don't block indefinitely here */
+                let timeoutId = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 5, () => {
+                    Gio.DBus.session.unwatch_name(watchId);
+                    log('Warning: Failed to start gsd-xsettings');
+                    task.return_boolean(true);
+                    timeoutId = 0;
+                    return GLib.SOURCE_REMOVE;
+                });
+
+                /* When gsd-xsettings daemon is started, we are good to resume */
+                let watchId = Gio.DBus.session.watch_name(
+                    'org.gnome.SettingsDaemon.XSettings',
+                    Gio.BusNameWatcherFlags.NONE,
+                    () => {
                         Gio.DBus.session.unwatch_name(watchId);
-                        log('Warning: Failed to start gsd-xsettings');
-                        task.return_boolean(true);
-                        timeoutId = 0;
-                        return GLib.SOURCE_REMOVE;
-                    });
-
-                    /* When gsd-xsettings daemon is started, we are good to resume */
-                    let watchId = Gio.DBus.session.watch_name(
-                        'org.gnome.SettingsDaemon.XSettings',
-                        Gio.BusNameWatcherFlags.NONE,
-                        () => {
-                            Gio.DBus.session.unwatch_name(watchId);
-                            if (timeoutId > 0) {
-                                task.return_boolean(true);
-                                GLib.source_remove(timeoutId);
-                            }
-                        },
-                        null);
-                }
+                        if (timeoutId > 0) {
+                            task.return_boolean(true);
+                            GLib.source_remove(timeoutId);
+                        }
+                    },
+                    null);
             } catch (e) {
                 log('Error starting gsd-xsettings: %s'.format(e.message));
+                task.return_boolean(true);
             }
 
             return true;